<?
include_once "fbmain.php";
include_once "common_functions.php";
$dir_final_log = $_GET['log_file'];
$final_video = $_GET['final_video'];
$ip_addr = get_ip();


$file_info_time = $dir_final_log."general.txt";
$scans = load_tabbed_file($file_info_time);
$file_info_time = $dir_final_log."step1-retrieve_pictures.txt";
$scans1 = load_tabbed_file($file_info_time);
$file_info_time = $dir_final_log."step2-find_faces.txt";
$scans2 = load_tabbed_file($file_info_time);
$file_info_time = $dir_final_log."step3-create_collage.txt";
$scans3 = load_tabbed_file($file_info_time);
$file_info_time = $dir_final_log."step4-create_video.txt";
$scans4 = load_tabbed_file($file_info_time);


//
// write to final log file
//
$myFile_log = "log2.txt";
$fid_log = fopen($myFile_log, 'a') or die("can't open file");
$today = date("Ymd");
$time = date("His");

//print_r($scans);
//print_r($scans1);
//print_r($scans2);
//print_r($scans3);
//print_r($scans4);

fwrite($fid_log, $ip_addr[0]."\t".$scans[0][0]."\t".$scans[0][1]."\t".$fbme['id']."\t".$fbme['first_name']."\t".$fbme['last_name']."\t".number_format($scans1[0][2], 2, '.', '')."\t".number_format($scans2[0][2], 2, '.', '')."\t".number_format($scans3[0][2], 2, '.', '')."\t".number_format($scans4[0][2], 2, '.', '')."\t".$ip_addr[1]."\n");
//fwrite($fid_log, $ip_addr[0]."\t".$me['id']."\t".$me['first_name']."\t".$me['last_name']."\t");
//fwrite($fid_log, $totaltime_fb_login_retrieve."\t".$totaltime_create_collage."\t".$totaltime_create_video."\t");
//fwrite($fid_log, $end_time_today."\t".$end_time_time."\t".$overall_duration."\t");
//fwrite($fid_log, $number_photo[0]."\t".$number_photo[1]."\t".$number_photo[2]."\t".$number_photo[3]."\t");
//fwrite($fid_log, $number_photo[3]/$number_faces."\t".$ip_addr[1]."\n");

fclose($fid_log);

echo("final_video=".$final_video);

?>
